define(function(require){
	var $=require("jq");
	var Dialog=require("/pinzhiV2.0/js/pz_use_dialog.js");
	$('.orderCancel_href').on('click',function(){
		var orderID = $(this).attr('orderid');
		var state = $(this).attr('state');
		var params = {};
		params['ColumnID'] = 1707;
		params['orderId'] = orderID;
		params[state] = 1;
		var tips=new Dialog({
			  type:"confirm",
			  text:"提示信息",
			  tipsText:"你确定要取消订单吗？",
			  buttonSureText:"确定", 
			  buttonCancelText:"暂不", 
			  callBack:function(){         //回调函数
				  $.get("/vipCenter/frontCancelOrder.do",params,function(data){
						var success = data.success;
						if(success != 1){
							var message = data.message||"";
							var width = message.length*20;
							var tips=new Dialog({
								 width: width,
								  type:"tips",
								  text:data.message,
								  delay:2
								  });
						}else{
							var tips=new Dialog({
									  type:"alert",
									  text:"提示",
									  tipsText:"取消成功！",
									  callBack:function(){
										  window.location.reload();
									  },
									  mask:0.3
									 });	
						};
					},"json");  
			  },
			  mask:0.3,
			  isDrag:true
			  });
	});
	$('.orderQianShow_href').on('click',function(){
		var orderID = $(this).attr('orderid');
		var state = $(this).attr('state');
		var params = {};
		params['ColumnID'] = 1713;
		params['orderId'] = orderID;
		params['typeid'] = 1;
		params['valueid'] = 7;
		params[state] = 4;
		params['elemId'] = state;
		var tips=new Dialog({
			  type:"confirm",
			  text:"提示信息",
			  tipsText:"你确定要签收订单吗？",
			  buttonSureText:"确定", 
			  buttonCancelText:"暂不", 
			  callBack:function(){         //回调函数
				  $.get("/vipCente/frontQianShowOrder.do",params,function(data){
						var success = data.success;
						if(success != 1){
							var tips=new Dialog({
								  type:"tips",
								  text:data.message,
								  delay:2
								  });
						}else{
							var tips=new Dialog({
									  type:"alert",
									  text:"提示",
									  tipsText:"签收成功！",
									  callBack:function(){
										  window.location.reload();
									  },
									  mask:0.3
									 });	
						};
					},"json");  
			  },
			  mask:0.3,
			  isDrag:true
			  });
	});
	$('.searchMode').find('ul').find('li').on('click',function(){
		var action = $(this).attr('action');
		window.location.href=action;
		return;
	});
});